package com.xcity.pomelo.response;

import com.alibaba.fastjson.annotation.JSONField;
import com.xcity.game.combat.Combat;
import com.xcity.game.combat.CombatTeam;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class CombatResponse extends Response {
	
	@JSONField(serialize = false)
	public Combat combat;
	
	public int id; // 战斗id
	public CombatTeam source, target;
	public int timeLimit; // 战斗限时（秒）（-1：不限时）
	
	public CombatResponse(int serial) {
		super(serial);
	}

	public CombatResponse(int serial, Combat combat) {
		this(serial, combat, -1);
	}
	
	public CombatResponse(int serial, Combat combat, int timeLimit) {
		super(serial);
		this.combat = combat;
		this.id = combat.getId();
		this.source = combat.getSource();
		this.target = combat.getTarget();
		this.timeLimit = timeLimit;
	}
	
}
